import web

urls = (
    '/index', 'index',
    '/hello', 'hello',
    '/doAction', 'doAction'

)
app = web.application(urls, globals())
class index:
    def GET(self):
        print('input: ')
        return 'hello, '

class hello:
    def GET(self,name):
        print('input: ' + name)
        return 'hello, ' + name
    def POST(self):
        web.header("Access-Control-Allow-Origin", "*")
        print(web.input().get("doName"))
        return 'hello,post '

class doAction:
    def POST(self):
        web.header("Access-Control-Allow-Origin", "*")
        doName = web.input().get("doName")
        if doName == "up":
            print(doName)

        return 'res'

if __name__ == '__main__':
    app.run()
